// 检查是否为对象
export const isPlainObj = data => {
  if ({}.toString.call(data) === '[object Object]') {
    return true
  }
  return false
}

// 把json对象转为query字符串
export const objToQuery = data => {
  let query = ''
  for (let key in data) {
    query += `&${key}=${data[key]}`
  }
  return query
}

